<?php 
namespace Admin\Controller;
use Hdphp\Library\Controller;
/**
 * 
 * 前台用户管理
 * 
 */

class UserController extends CommonController{

	public function index(){
		$sql="SELECT * FROM hd_user";
		$user=M()->query($sql);
		$this->assign('user',$user);
		$this->display();
	}

	public function lock(){
		$uid=intval($_GET['uid']);
		$sql="UPDATE hd_user SET hd_user.lock=1 WHERE uid={$uid} ";
		if(M()->exec($sql)){
			$this->error('锁定成功');
			// ,'./index.php?m=admin&c=user'
		}
	}

	public function unlock(){
		$uid=intval($_GET['uid']);
		$sql="UPDATE hd_user SET hd_user.lock=0 WHERE uid={$uid} ";
		if(M()->exec($sql)){
			$this->error('解锁成功');
		}
	}
}
 ?>